package com.wanxi.servlet.newsclassification;//package com.wanxi.servlet.newsclassification;
//
//import com.alibaba.fastjson2.JSONObject;
//import com.wanxi.model.NewsclassificationModel;
//import com.wanxi.model.ResultModel;
//import com.wanxi.service.NewsclassificationService;
//import com.wanxi.service.impl.NewsclassificationServiceImpl;
//import com.wanxi.util.Tool;
//
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//
//@WebServlet("/back/newsclassification/findAll")
//public class NewsclassificationFindAllServlet extends HttpServlet {
//    @Override
//    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        //1.乱码处理
//
//        //2.得到前端的值
//        String name = req.getParameter("name");
//        String id = req.getParameter("id");
//        String isShow = req.getParameter("isShow");
//        String createTime = req.getParameter("createTime");
//        String updateTime = req.getParameter("updateTime");
//        //3.封装到model
//        NewsclassificationModel newsclassificationModel=new NewsclassificationModel();
//        newsclassificationModel.setName(Tool.nullToStr(name));
//        newsclassificationModel.setId(Tool.strToInt(id));
//        newsclassificationModel.setIsShow(Tool.strToInt(isShow));
//        newsclassificationModel.setUpdateTime(Tool.nullToDate(updateTime));
//        newsclassificationModel.setCreateTime(Tool.nullToDate(createTime));
//        //  4.调用service
//        NewsclassificationService newsclassificationService=new NewsclassificationServiceImpl();
//        //5.调用service的方法并得到返回值
//        ResultModel resultModel=newsclassificationService.findAll(newsclassificationModel);
//        //6.返回前端
//        resp.getWriter().println(JSONObject.toJSONString(resultModel));
//    }
//}
